import type { AxiosRequestConfig } from 'axios'

import type { PartialRequired } from './util'

type RequestMethodType = 'get' | 'post' | 'put' | 'delete'

type RequestOptionsType<T = unknown> = PartialRequired<
  Pick<
    AxiosRequestConfig<T>,
    | 'url'
    | 'method'
    | 'headers'
    | 'hasLoader'
    | 'download'
    | 'data'
    | 'timeout'
    | 'timeoutErrorMessage'
    | 'withCredentials'
    | 'responseType'
  >,
  'url'
>

type ResponseDataType<T = unknown> = {
  success: boolean
  message: string
  content: T
}

export type { RequestMethodType, RequestOptionsType, ResponseDataType }
